import 'package:flutter/material.dart';
import 'package:flutter_one/class/app/user/vm/UserPageViewModel.dart';
import 'package:flutter_one/class/appbase/BaseView.dart';
import 'package:flutter_one/class/appsetting/setting.dart';
import 'package:flutter_one/class/utils/Utils.dart';

class UserPageView extends StatefulWidget {
  const UserPageView({super.key});

  @override
  State<StatefulWidget> createState() => _UserPageViewState();
}

class _UserPageViewState extends State<UserPageView> {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return BaseView<UserPageViewModel>(
        viewModel: UserPageViewModel(),
        build: (context, viewModel, child) {
          return Scaffold(
            backgroundColor: K_APP_BACKGROUND_COLOR,
            appBar: Utils.shareInstance.customPageBar('我的'),
            body: _setBody(),
          );
        },
        onModelReady: (viewModel) {
          //请求数据
          debugPrint("User-onModelReady");
        });
  }
}

/*扩展*/
extension on _UserPageViewState {
  Widget _setBody() {
    debugPrint("_UserPageViewState-_setBody");
    return const Text('我的-视图');
  }
}
